package com.ruoyi.dzzh.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dzzh.mapper.DzzhPhoneMapper;
import com.ruoyi.dzzh.domain.DzzhPhone;
import com.ruoyi.dzzh.service.IDzzhPhoneService;

/**
 * 短信群发Service业务层处理
 * 
 * @author cjt
 * @date 2022-05-19
 */
@Service
public class DzzhPhoneServiceImpl implements IDzzhPhoneService 
{
    @Autowired
    private DzzhPhoneMapper dzzhPhoneMapper;

    /**
     * 查询短信群发
     * 
     * @param phoneId 短信群发主键
     * @return 短信群发
     */
    @Override
    public DzzhPhone selectDzzhPhoneByPhoneId(Long phoneId)
    {
        return dzzhPhoneMapper.selectDzzhPhoneByPhoneId(phoneId);
    }

    /**
     * 查询短信群发列表
     * 
     * @param dzzhPhone 短信群发
     * @return 短信群发
     */
    @Override
    public List<DzzhPhone> selectDzzhPhoneList(DzzhPhone dzzhPhone)
    {
        return dzzhPhoneMapper.selectDzzhPhoneList(dzzhPhone);
    }

    /**
     * 新增短信群发
     * 
     * @param dzzhPhone 短信群发
     * @return 结果
     */
    @Override
    public int insertDzzhPhone(DzzhPhone dzzhPhone)
    {
        dzzhPhone.setCreateTime(DateUtils.getNowDate());
        return dzzhPhoneMapper.insertDzzhPhone(dzzhPhone);
    }

    /**
     * 修改短信群发
     * 
     * @param dzzhPhone 短信群发
     * @return 结果
     */
    @Override
    public int updateDzzhPhone(DzzhPhone dzzhPhone)
    {
        dzzhPhone.setUpdateTime(DateUtils.getNowDate());
        return dzzhPhoneMapper.updateDzzhPhone(dzzhPhone);
    }

    /**
     * 批量删除短信群发
     * 
     * @param phoneIds 需要删除的短信群发主键
     * @return 结果
     */
    @Override
    public int deleteDzzhPhoneByPhoneIds(Long[] phoneIds)
    {
        return dzzhPhoneMapper.deleteDzzhPhoneByPhoneIds(phoneIds);
    }

    /**
     * 删除短信群发信息
     * 
     * @param phoneId 短信群发主键
     * @return 结果
     */
    @Override
    public int deleteDzzhPhoneByPhoneId(Long phoneId)
    {
        return dzzhPhoneMapper.deleteDzzhPhoneByPhoneId(phoneId);
    }
}
